package com.simple.base.common.exception;



import com.simple.base.common.result.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author weijian.du
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SystemException extends RuntimeException {

    private static final long serialVersionUID = 5430196586536884942L;

    private int code;
    private String msg;

    public SystemException() {
        super();
    }

    public SystemException(ResultCode resultCode) {
        super(resultCode.getMsg());
        this.code = resultCode.getCode();
        this.msg = resultCode.getMsg();
    }

    public SystemException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public SystemException(Throwable e) {
        super(e);
    }

    public SystemException(String msg, Throwable e) {
        super(msg, e);
    }


}
